<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Location对象</title>
</head>
<body>
<button onclick="gobbing()">去百度首页</button>
<script>
    function gobbing(){
        location.href="..";
    }
    console.log(location.host)
    console.log(location.port)
    console.log(location.hostname)
    console.log(location.pathname)
    console.log(location.href)
</script>
</body>
</html>